﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace Xinnos.Lca.Yacht.Analyzer.View
{
    internal class GraphConfigurationViewModel:INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        private bool mMarginVisibleX = false;
        private bool mMarginVisibleY = false;

        #region 3D Configuration
        private bool mEnable3D = false;
        private int mInclination = 0;
        private int mRotation = 0;
        private int mPerspective = 0; 
        #endregion

        private bool mLegendVisible = false;

        public bool MarginVisibleX
        {
            get { return mMarginVisibleX; }
            set
            {
                mMarginVisibleX = value;
                RaisePropertyChanged("MarginVisibleX");
            }
        }
        public bool MarginVisibleY
        {
            get { return mMarginVisibleY; }
            set
            {
                mMarginVisibleY = value;
                RaisePropertyChanged("MarginVisibleY");
            }
        }
        public bool Enable3D
        {
            get { return mEnable3D; }
            set
            {
                mEnable3D = value;
                RaisePropertyChanged("Enable3D");
            }
        }
        public int Inclination
        {
            get { return mInclination; }
            set
            {
                mInclination = value;
                RaisePropertyChanged("Inclination");
            }
        }
        public int Rotation
        {
            get { return mRotation; }
            set
            {
                mRotation = value;
                RaisePropertyChanged("Rotation");
            }
        }
        public int Perspective
        {
            get { return mPerspective; }
            set
            {
                mPerspective = value;
                RaisePropertyChanged("Perspective");
            }
        }
        public bool LegendVisible
        {
            get { return mLegendVisible; }
            set
            {
                mLegendVisible = value;
                RaisePropertyChanged("LegendVisible");
            }
        }

        public GraphConfigurationViewModel()
        {
            this.Inclination = 45;
            this.Rotation = 45;
            this.Perspective = 0;
        }

        private void RaisePropertyChanged(string strPropertyName)
        {
            PropertyChangedEventHandler _handler = this.PropertyChanged;
            if (null != _handler) _handler(this, new PropertyChangedEventArgs(strPropertyName));
        }
    }
}